/*
 * @Author: yc
 * @Date: 2020-05-31 12:17:39
 * @LastEditTime: 2020-05-31 12:18:12
 * @FilePath: \react-admin\src\requests\api\notification.js
 */

import http from '../index'

// 获取消息列表
export const getNotifications = () => {
  return http({
    url: '/api/notification/getByUserId',
    method: 'get'
  })
}

// 根据id将消息设置为已读
export const postNotificationAsReadById = (id) => {
  return http({
    url: '/api/notification/markNotificationAsReadById',
    method: 'post',
    data: {
      id
    }
  })
}

// 将用户下的消息全部设置为已读
export const postAllNotificationAsRead = () => {
  return http({
    url: '/api/notification/markAllNotificationAsRead',
    method: 'post'
  })
}
